<?php
declare (strict_types = 1);

namespace app\controller\api\v1\site;

use app\controller\api\ApiController;
use app\service\logic\common\maintain\InfoService;
use think\App;
use think\Request;
use think\response\Json;

class InfoController extends ApiController
{
    protected $service;

    public function __construct(App $app, InfoService $service)
    {
        parent::__construct($app);
        $this->service = $service;
    }

    /**
     * 显示资源
     *
     * @param Request $request
     * @return Json
     */
    public function read(Request $request): Json
    {
        $params = $request->only(['type']);
        $result = $this->service->getSimpleDetail($params);
        return amis($result);
    }
}
